package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.WGoodMapper;
import com.ruoyi.system.domain.WGood;
import com.ruoyi.system.service.IWGoodService;

/**
 * 物品Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-01-06
 */
@Service
public class WGoodServiceImpl implements IWGoodService{
    @Autowired
    private WGoodMapper wGoodMapper;

    /**
     * 查询物品
     * 
     * @param id 物品ID
     * @return 物品
     */
    @Override
    public WGood selectWGoodById(Long id){
        return wGoodMapper.selectWGoodById(id);
    }

    /**
     * 查询物品列表
     * 
     * @param wGood 物品
     * @return 物品
     */
    @Override
    public List<WGood> selectWGoodList(WGood wGood){
        return wGoodMapper.selectWGoodList(wGood);
    }

    /**
     * 新增物品
     * 
     * @param wGood 物品
     * @return 结果
     */
    @Override
    public int insertWGood(WGood wGood){
        wGood.setCreateTime(DateUtils.getNowDate());
        return wGoodMapper.insertWGood(wGood);
    }

    /**
     * 修改物品
     * 
     * @param wGood 物品
     * @return 结果
     */
    @Override
    public int updateWGood(WGood wGood){
        wGood.setUpdateTime(DateUtils.getNowDate());
        return wGoodMapper.updateWGood(wGood);
    }

    /**
     * 批量删除物品
     * 
     * @param ids 需要删除的物品ID
     * @return 结果
     */
    @Override
    public int deleteWGoodByIds(Long[] ids){
        return wGoodMapper.deleteWGoodByIds(ids);
    }

    /**
     * 删除物品信息
     * 
     * @param id 物品ID
     * @return 结果
     */
    @Override
    public int deleteWGoodById(Long id){
        return wGoodMapper.deleteWGoodById(id);
    }
}
